package com.sample.entity;

import com.swak.App;
import com.swak.annotation.Table;
import com.swak.persistence.BaseMapper;
import com.swak.persistence.Model;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 描述
 * 
 * @author Auto Generator
 * @date 2022-04-21T20:46:30.806130
 */
@Getter
@Setter
@Accessors(chain = true)
@Table(value="SWAK_GOODS")
public class Goods extends Model<Goods, Long> {
	
	@lombok.EqualsAndHashCode.Exclude
	@lombok.ToString.Exclude
	private static volatile transient BaseMapper<Goods, Long> _mapper;
	
	public static final String Id = "ID";
	public static final String Name = "NAME";
	public static final String Price = "PRICE";
	public static final String Quantity = "QUANTITY";
	public static final String Freeze = "FREEZE";
	public static final String CreateDate = "CREATE_DATE";
	public static final String UpdateDate = "UPDATE_DATE";
	public static final String DelFlag = "DEL_FLAG";
	public static final String DelAt = "DEL_AT";
	
	private String name;
	private java.math.BigDecimal price;
	private Integer quantity;
	private Integer freeze;
	
	@Override
	@SuppressWarnings("unchecked")
	protected BaseMapper<Goods, Long> getSqlRunner() {
		if (_mapper == null) {
			synchronized (Goods.class) {
				if (_mapper == null) {
					_mapper = (BaseMapper<Goods, Long>) App.getBean(getTableDefine().getMapper());
				}
			}
		}
		return _mapper;
	}
	
	public static Goods of() {
	    return new Goods();
	}
}
